layui.use(function () {
    var $ = layui.jquery;
    $.ajaxSetup({
        type: 'post',
        timeout: 30000,
        cache: false,
        beforeSend: function () {
            //if (this.url.indexOf('Home') < 0) {
            layer.load(0);
            //}
        },
        error: function (xhr) {
            console.log(xhr);;
        },
        complete: function () {
            //if (this.url.indexOf('Home') < 0) {
            layer.closeAll("loading");
            //}
        }
    });
    document.onkeydown = function (event) {
        var e = event.target;
        if (event.key === "Enter") {
            if (document.getElementById("btnQuery"))
                document.getElementById("btnQuery").click();
            return false;
        }
    };
});